<?php
namespace App\Http\Controllers\Home;

use App\Models\Member;
use App\Models\TxOrder;

class MyeduController extends BaseController{

    public function __construct(Member $member , TxOrder $txOrder)
    {
         parent::__construct();
         $this->member = $member;
         $this->txorder = $txOrder;
    }

    // 提现视图
    public function getIndex()
    {
         $txlist = $this->txorder->getOrderList();
         $res = $this->member->getMemberById(session('uid'));
         return view('home.member.myedu',compact('res','txlist'));
    }

    // 提现处理
    public function postDoTx()
    {
         $res = $this->txorder->addTxOrder(request());
         return redirect()->back()->with('message', $res['msg'])->withInput();
    }

    public function getIco()
    {
        return view('home.member.ico');
    }
}